﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubicFWNet.Data.Models.Mapping
{
    public class PurchaseReconciliationMap : EntityTypeConfiguration<PurchaseReconciliation>
    {
        public PurchaseReconciliationMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            this.Property(t => t.CreatorName)
                .HasMaxLength(64);

            this.Property(t => t.FinanceNumber)
                .HasMaxLength(256);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            this.ToTable("PurchaseReconciliation");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
            this.Property(t => t.CreatorName).HasColumnName("CreatorName");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.ApplyTime).HasColumnName("ApplyTime");
            this.Property(t => t.ShouldAmount).HasColumnName("ShouldAmount");
            this.Property(t => t.ActualAmount).HasColumnName("ActualAmount");
            this.Property(t => t.Memo).HasColumnName("Memo");
            this.Property(t => t.PurchaseComposeId).HasColumnName("PurchaseComposeId");
            this.Property(t => t.FinanceNumber).HasColumnName("FinanceNumber");

            this.Property(t => t.TotalMoney).HasColumnName("TotalMoney");
            this.Property(t => t.ReconciliationType).HasColumnName("ReconciliationType");
        }
    }
}
